package com.jt.controller;

import com.jt.pojo.Rights;
import com.jt.service.RightsService;
import com.jt.vo.SysResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/*
@RestController
@CrossOrigin
@RequestMapping("/rights")
public class RightsController {
    @Autowired
    private RightsService rightsService;

    @RequestMapping("/getALL")
    public List<Rights>getALL(){
        return  rightsService.getAll();
    }
    */
/*
    * 需求:/rights/getRightsList
    * 参数:暂时没有
    * 返回值:SysResult对象(list集合)
    * *//*

    @GetMapping("/getRightsList")
    public SysResult getRightsList(){
        List<Rights> rightsList = rightsService.getRightsList();
        return  SysResult.success(rightsList);
    }
}
*/
@RestController
@CrossOrigin
@RequestMapping("/rights")
public class RightsController {
    @Autowired
    private  RightsService rightsService;
    @GetMapping("/getRightsList")
    public SysResult getRightsList(){
        List<Rights>rightsList= rightsService.getRightsList();
        return SysResult.success(rightsList);
    }

}
